getopt: getopt.c output_dir
	gcc getopt.c -o $@ -Wall 
	mv $@ output_dir/
	
pipe: pipe.o output_dir
	gcc pipe.c -o pipe -Wall -lpthread 
	mv $@ output_dir/

select:select.o output_dir
	gcc select.c -o select -Wall 
	mv $@ output_dir/
	
gettimeofday:gettimeofday.o output_dir
	gcc $^  -o $@ -Wall 
	mv $@ output_dir/

fork_and_wait:fork_and_wait.o output_dir
	gcc $^  -o $@ -Wall 
	mv $@ output_dir/


popen:popen.o output_dir
	gcc $<  -o $@ -Wall 
	mv $@ output_dir/

mkfifo: mkfifo.o output_dir
	gcc $<  -o $@ -Wall -lpthread
	mv $@ output_dir/

pthread_mutex:pthread_mutex.c output_dir
	gcc $<  -o $@ -Wall -lpthread
	mv $@ output_dir/
	
pthread_cond:pthread_cond.c pthread_cond_test.c output_dir
	gcc pthread_cond.c pthread_cond_test.c -g -o $@ -Wall -lpthread
	mv $@ output_dir/

pthread:pthread.c output_dir
	gcc $<  -o $@ -Wall -lpthread
	mv $@ output_dir/

mq_receive:mq_receive.c output_dir
	gcc $<  -o $@ -Wall -lpthread -lrt
	mv $@ output_dir/
	
mq_send:mq_send.c output_dir
	gcc $<  -o $@ -Wall -lpthread -lrt
	mv $@ output_dir/

unix_domain:unix_domain.c output_dir
	gcc $<  -o $@ -Wall 
	mv $@ output_dir/
	
readwrite:read_write.c output_dir
	gcc $<  -o $@ -Wall 
	mv $@ output_dir/
	
output_dir:
	mkdir output_dir

%o: %c
	gcc -g -c $^  -o $@ -Wall 

clean:
	rm *.o
